<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
    </style>
  </head>
  <body>

    <script>
      var divEle = document.createElement("div");
      divEle.style = "width:80px;border:1px solid pink";
      document.documentElement.onmousemove = function (event) {
        var event = event || window.event;
        var x = event.pageX;
        var y = event.pageY;
        divEle.innerHTML = `(${x},${y})`;
        divEle.style.marginLeft = `${event.pageX}px`;
        divEle.style.marginTop = `${event.pageY}px`;
        document.documentElement.appendChild(divEle);
      };
    </script>
  </body>
</html>
